package day8homework;

public class Worker extends Person {
	private String company;
	private int yearOfWork;
	
	public Worker() {
	}
	
	public Worker(String company, int yearOfWork) {
		super();
		this.company = company;
		this.yearOfWork = yearOfWork;
	}
	
	@Override
	public String toString() {
		return "Worker [company=" + company + ", yearOfWork=" + yearOfWork + "]";
	}

	@Override
	public void work() {
		System.out.println("工人的工作是搬砖");
	}

	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public int getYearOfWork() {
		return yearOfWork;
	}

	public void setYearOfWork(int yearOfWork) {
		this.yearOfWork = yearOfWork;
	}
	
}
